Skip to content

Conversation

@nicoburns
Copy link
Contributor

@nicoburns nicoburns commented Apr 30, 2023

Objective

  • Allow the _cssparser_internal_to_lowercase macro to be used in crates that set #[forbid(unsafe)].
  • Document the safety invariant for this unsafe block

Changes made

  • Wrap the unsafe block in the _cssparser_internal_to_lowercase macro in an #[inline(always)] function.
  • Add comments

Context

This allows it to be used in codebases with #[forbid(unsafe)].
Also document the safety invariant for the unsafe block
@SimonSapin
Copy link
Member

Oh, good idea! This is now possible with const generics

@bors-servo r+

@bors-servo
Copy link
Contributor

📌 Commit 39ea1b0 has been approved by SimonSapin

@bors-servo
Copy link
Contributor

⌛ Testing commit 39ea1b0 with merge b0c1761...

@bors-servo
Copy link
Contributor

☀️ Test successful - checks-github
Approved by: SimonSapin
Pushing b0c1761 to master...

@bors-servo bors-servo merged commit b0c1761 into servo:master Apr 30, 2023
@nicoburns nicoburns deleted the encapsulate-unsafe-in-macro branch April 30, 2023 15:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants